package com.sandy.demo.jpa;

public enum MovieType implements IBaseDbEnum {
    CARTOON(10, "卡通"),
    VARIETY(20, "综艺");

    private String name;
    private int value;

    private AddressType address;

    MovieType(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    @Override
    public int getValue() {
        return value;
    }

    @Override
    public String toString() {
        return name;
    }

    public static MovieType parseName(String name) {
        for (MovieType each : values()) {
            if (each.name.equals(name)) {
                return each;
            }
        }
        return null;
    }
}
